package com.ce.framework.ant;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;

public class GenUpdateJarName extends Task {

	private String propName;
	private String pre;
	/**
	 * 开发人：andy
	 * 开发日期: 2013-11-14  上午10:47:33
	 * 功能描述: 
	 * 方法的参数和返回值: 
	 * @param args
	 */
	public static void main(String[] args) {
		SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmm");
		String str = df.format(new Date()).substring(2);
		long l = 10000000000L-Long.parseLong(str,10);
		System.out.println("_"+l+"_"+str);
	}

	public void execute() throws BuildException {
		SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmm");
		String str = df.format(new Date()).substring(2);
		long l = 10000000000L-Long.parseLong(str,10);
		getProject().setProperty(propName, pre+"_"+l+"_"+str);
	}
	public String getPropName() {
		return propName;
	}

	public void setPropName(String propName) {
		this.propName = propName;
	}

	public String getPre() {
		return pre;
	}

	public void setPre(String pre) {
		this.pre = pre;
	}

}
